package com.yiwyn;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;

public class PrefixedAppender extends AppenderBase<ILoggingEvent> {
    private String prefix;

    public PrefixedAppender(String prefix) {
        this.prefix = prefix;
    }

    @Override
    protected void append(ILoggingEvent eventObject) {
        String message = prefix + eventObject.getFormattedMessage();
        System.out.println(message); // 可以替换为其他输出方式
    }
}
